package com.qutan.app.quartz;

import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
import org.quartz.impl.StdSchedulerFactory;
import org.springframework.stereotype.Service;

/**
 * Created by pengweiyuan on 4/22/16.
 */
@Service
public class JopRunner {

    public void startQuartz(){
        try {
            SchedulerFactory schedulerFactory=new StdSchedulerFactory("quartz.properties");
            Scheduler scheduler=schedulerFactory.getScheduler();
            scheduler.start();
        } catch (SchedulerException e) {
            e.printStackTrace();
        }
    }

   public static void main(String[]args){
      /* try {
           SchedulerFactory schedulerFactory=new StdSchedulerFactory("quartz.properties");
           Scheduler scheduler=schedulerFactory.getScheduler();
           scheduler.start();
       } catch (SchedulerException e) {
           e.printStackTrace();
       }*/
   }

}
